cmake_minimum_required(VERSION 3.20)
project(algothrim)

set(CMAKE_CXX_STANDARD 14)

add_executable(algothrim main.cpp "785quick_sort.cpp" "787merge_sort.cpp"
        "789rangeOfNumbers.cpp" 790CubicRootOfNumber.cpp 791LargeNumberAddition.cpp
        792largeNumberSub.cpp 793largeNumberMulti.cpp 794largeNumberDiv.cpp 795prefixSum.cpp
        796sumOfSubMatrix.cpp 797difference.cpp 798differenceMatrix.cpp 786topK.cpp 788numberOfReversePairs.cpp 799theLongestUnduplicatedSubarray.cpp 801numberOf_1_inBinary.cpp 802intervalSum.cpp 803intervalMerge.cpp 826staticSinglyLinkedList.cpp)

# 遍历项目根目录下所有的 .cpp 文件 解决不能多个main函数问题；每次创建一个cpp文件后要
file (GLOB files *.cpp)
foreach (file ${files})
    string(REGEX REPLACE ".+/(.+)\\..*" "\\1" exe ${file})
    add_executable (${exe} ${file})
    message (\ \ \ \ --\ src/${exe}.cpp\ will\ be\ compiled\ to\ bin/${exe})
endforeach ()
